<!DOCTYPE html>
<html>
<head>
    <title>添加药品--中软高科-2015</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="../Css/style.css" />
    <script type="text/javascript" src="../Js/jquery.js"></script>
    <script type="text/javascript" src="../Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../Js/ckform.js"></script>
    <script type="text/javascript" src="../Js/common.js"></script>
    <script type="text/javascript" src="../Js/ckeditor/ckeditor.js"></script>
 

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }

    </style>
    <script type="text/javascript">

    $(function () {
        //保存按钮新增药品
        $("#addMedicine").click(function(){
            $.ajax({
                type:"POST",
                url:"/drug/",
                data:$("#myForm").serialize(),
                dataType:"json",
                success: function(vo){
                    if(vo.code==200) {
                        window.location.href = "/medicine/index.html";
                    }else{
                        alert("添加失败！"+vo.msg);
                    }
                }
            });

        });

		$('#backList').click(function(){
				window.location.href="index.html";
		 });

    });
    </script>
</head>
    <body>
        <form id="myForm" class="definewidth m20">
            <table class="table table-bordered table-hover definewidth m10">
                <tr>
                    <td width="10%" class="tableleft">药品编号</td>
                    <td><input type="text" name="id" value=""/></td>
                </tr>
                <tr>
                    <td width="10%" class="tableleft">图片</td>
                    <td><input type="file" name="img" value=""/></td>
                </tr>
                <tr>
                    <td width="10%" class="tableleft">进价</td>
                    <td><input type="text" name="inPrice" value=""/></td>
                </tr>
                <tr>
                    <td width="10%" class="tableleft">售价</td>
                    <td><input type="text" name="outPrice" value=""/></td>
                </tr>
                <tr>
                    <td width="10%" class="tableleft">药品名称</td>
                    <td><input type="text" name="drugName" value=""/></td>
                </tr>
                <tr>
                    <td width="10%" class="tableleft">药品类型</td>
                    <td>
                        <label>
                            <select name="drugType">
                                <option value="">请选择药品类型</option>
                                <option value="中药">中药</option>
                                <option value="西药">西药</option>
                                <option value="处方">处方</option>
                                <option value="非处方">非处方</option>
                            </select>
                        </label>
                    </td>
                </tr>
                <tr>
                    <td width="10%" class="tableleft">简单描述</td>
                    <td><input type="text" name="description" value=""/></td>
                </tr>

                <tr>
                    <td width="10%" class="tableleft">保质期</td>
                    <td><input type="text" name="quality" value="36"/>月</td>
                </tr>
                <tr>
                    <td width="10%" class="tableleft">详细描述</td>
                    <td><textarea name="detailDescription"></textarea></td>
                </tr>
                <tr>
                    <td width="10%" class="tableleft">生产厂商</td>
                    <td><textarea name="factory"></textarea></td>
                </tr>
                <tr>
                    <td width="10%" class="tableleft">服用说明</td>
                    <td><input type="text" name="instruction" value=""/></td>
                </tr>

                <tr>
                    <td width="10%" class="tableleft">备注</td>
                    <td><textarea name="note"></textarea></td>
                </tr>
                <tr>
                    <td colspan="2">
                        <center>
                            <button id="addMedicine" name="addMedicine" class="btn btn-primary" type="button">保存</button> &nbsp;&nbsp;
                            <button id="backList" class="btn btn-success" type="button">返回列表</button>
                        </center>
                    </td>
                </tr>
            </table>
        </form>
    </body>
</html>